package hu.village.utils;

import hu.village.mapper.UserMapper;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.TimerTask;

@Component
@Slf4j
public class TimeTask extends TimerTask {

    @Autowired
    private UserMapper userMapper;

    @Getter
    @Setter
    private String email;
    @Getter
    @Setter
    private String state;

    public TimeTask(){
//        this.email = email;
//        this.state = state;
    }


    @Override
    public void run() {
        log.info("要删除的邮箱:{},类型:{}",email,state);
        userMapper.deleteCodeByEmail(email,state);
    }
}
